<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--

    Copyright 2010 Västra Götalandsregionen

      This library is free software; you can redistribute it and/or modify
      it under the terms of version 2.1 of the GNU Lesser General Public
      License as published by the Free Software Foundation.

      This library is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      GNU Lesser General Public License for more details.

      You should have received a copy of the GNU Lesser General Public
      License along with this library; if not, write to the
      Free Software Foundation, Inc., 59 Temple Place, Suite 330,
      Boston, MA 02111-1307  USA


-->

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	template="/layouts/loggedOutTemplate.xhtml">

	<ui:define name="content">

		<ui:fragment id="loginFragment">
			<div class="row-fluid">
				<div class="hidden-phone">
					<h3>
						<h:outputText value="#{baseMsg.loginpageMainHeader}" />
					</h3>
					<p>
						<h:outputText value="#{baseMsg.loginpageIntroMsg1}" />
					</p>
					<p>
						<h:outputText value="#{baseMsg.loginpageIntroMsg2}" />
					</p>
					<p>
						<h:outputText value="#{baseMsg.loginpageIntroInfoLink}"
							escape="false" />
					</p>
					<p>
						<h:outputText value="#{baseMsg.loginpageIntroHelpLink}"
							escape="false" />
					</p>
				</div>

				<div id="forms-container" class="span8 offset2 login-container">
					<div class="well">
						<h:form id="mainForm" class="form-horizontal">
							<legend>
								<h:outputText value="#{baseMsg.loginpageSubHeaderLogin}" />
							</legend>
							<ui:fragment rendered="#{failedLogin}">
								<div class="alert alert-error">
									<strong><h:outputText
											value="#{baseMsg.loginpageErrorLoginFailed}" /> </strong>
									<p>
										<h:outputText
											value="#{baseMsg.loginpageErrorLoginFailedAdvice1}" />
									</p>
									<p class="hidden-phone">
										<h:outputText
											value="#{baseMsg.loginpageErrorLoginFailedAdvice2}" />
									</p>
								</div>
							</ui:fragment>
							<ui:fragment rendered="#{WSConnectionError}">
								<div class="alert alert-error">
									<strong><h:outputText
											value="#{baseMsg.loginpageErrorWebServiceConnectionError1}" /></strong>
									<p><h:outputText
											value="#{baseMsg.loginpageErrorWebServiceConnectionError2}" /></p>
								</div>
							</ui:fragment>
							<p>
								<h:outputText value="#{baseMsg.loginpagePasswordInstruction}" />
							</p>
							<div class="control-group">
								<h:outputLabel for="pnr" class="control-label">
									<h:outputText value="#{baseMsg.loginpageIdNumberLabel}" />
								</h:outputLabel>
								<div class="controls">
									<h:inputText id="pnr" value="#{state.pnr}" />
								</div>
							</div>
							<div class="control-group">
								<h:outputLabel for="passwd" class="control-label">
									<h:outputText value="#{baseMsg.loginpagePasswordLabel}" />
								</h:outputLabel>
								<div class="controls">
									<h:inputSecret id="passwd" value="#{state.passwd}" />
								</div>
							</div>
							<div class="control-group">
								<div class="controls">
									<h:commandButton id="login" styleClass="btn btn-primary"
										value="Logga in" processIds="*" action="login" />
								</div>
							</div>
						</h:form>
					</div>
				</div>
			</div>
		</ui:fragment>
	</ui:define>
</ui:composition>
